{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<section class="content-header">
    <h1>{$Think.lang.c_title}{$Think.lang.list}</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title"></h3>
                    <div class="pull-left">
                        {:auth_action(CONTROLLER_NAME.'/delete', 'box', lang('delete'), '', 'danger', 'sm', 'trash')} 
                    </div>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <th width="35"><input type="checkbox" class="minimal checkbox-toggle"></th>
                            <th>{$Think.lang.ordersn}</th>
                            <th>{$Think.lang.goods}</th>
                            <th>{$Think.lang.star}</th>
                            <th>{$Think.lang.content}</th>
                            <th>{$Think.lang.img}</th>
                            <th>{$Think.lang.create_time}</th>
                            <th>{$Think.lang.people}</th>
                            <th width="124">{$Think.lang.action}</th>
                        </tr>
                        {volist name="data" id="vo"}
                        <tr>
                            <td><input type="checkbox" name="id[]" value="{$vo.id}" class="minimal"></td>
                            <td>{:str_repeat("-",$vo["level"]*4)}{$vo->order->ordersn}</td>
                            <td>{$vo->good->good_title}</td>
                            <td>
                                {if $vo.is_one}
                                {$vo.star}
                                {/if}
                            </td>
                            <td>{$vo.content}</td>
                            <td><img src="{$vo.img}" style="width: 50px;"></td>
                            <td>{$vo.create_time}</td>
                            <td>
                                {if $vo.mid}{$vo->order->m_name}{/if}
                                {if $vo.agent_id}{$vo->agent->agentname}{/if}
                                {if $vo.uid}{$vo->user->username}{/if}
                            </td>
                            <td>
                                {:auth_action(CONTROLLER_NAME.'/reply', 'a', lang('reply'), ['id' => $vo.id])} 
                                {:auth_action(CONTROLLER_NAME.'/delete', 'box', lang('delete'), $vo.id, 'danger', 'xs', 'trash')}
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$dataList->render()|raw}
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
$(function(){
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
        checkboxClass: 'icheckbox_minimal-blue',
        radioClass: 'iradio_minimal-blue'
    });
    
    /*全选-反选*/
    $('.checkbox-toggle').on('ifChecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("check");
    });
    $('.checkbox-toggle').on('ifUnchecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("uncheck");
    });

    $('.editable').editable({
        emptytext: "empty",
        params: function(params) {      //参数
            var data = {};
            data['id'] = params.pk;
            data[params.name] = params.value;
            return data;
        },
        success: function(response, newValue) {
            var res = $.parseJSON( response );
            if(res.status == 1){
                toastr.success(res.info);
            }else{
                return res.info;
            }
        }
    });
})
</script>
{/block}
│　　　├